<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="root"></div>

    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>

    <script type="text/babel">
        // 大括号中可以放置 JS 的表达式, 表达式的值这几种: string, number, 虚拟 DOM 对象
        /**
         * JS 的表达式
         *  * 变量
         *  * 对象属性  obj.name  obj.a.b
         *  * 三元运算符   a ? 'aa' : 'bb'
         *  * 四则运算  取余
         *  * 逻辑运算符
         * 
         * 字面量值:
         *  数字
         *  字符串
         *  undefined
         *  null 
         *
         * 
         * if...else   while  for   JS 语句  固定结构
         * 
         */
        let name = 'H5211227';

        // var vDOM = <div>{name}</div>;
        // var vDOM = <div>{100 % 3}</div>;
        // var vDOM = <div>{'abc'}</div>;
        // var vDOM = <div>{123}</div>;
        // var vDOM = <div>{<span>测试</span>}</div>;
        // var vDOM = <div>{false}</div>;
        // var vDOM = <div>{null}</div>;
        // var vDOM = <div>{undefined}</div>;
        // var vDOM = <div>{{}}</div>;
        let arr = [1,2,3];
        let arr2 = ['abc','xyz','456'];
        let arr3 = [<span>123</span>, <p>456</p>, <div>789</div>];

        let vDOM = <div>{arr3}</div>

        ReactDOM.render(vDOM, document.querySelector("#root"));

    </script>
</body>
</html>